import api from "./index";

/** 兑换商城列表(cy)
 * @param {Object} param
 */
export const shoppingMallList = param =>
  api.get("/api/my/shoppingMall/list", param);

/** 我的花瓣/花朵数，头像、姓名(cy)
 * @param {Object} param
 */
export const getFlowerNum = param =>
  api.get("/api/my/flower/getFlowerNum", param);

/** 更多商品(cy)
 * @param {Object} param
 * @param {number} param.id 栏目id
 * @param {number} param.page   栏目id
 */
export const moreGoods = param =>
  api.get("/api/my/shoppingMall/moreGoods", param);

/** 商品详情（cy）
 * @param {Object} param
 * @param {number} param.cate_id 栏目id
 * @param {number} param.id  商品id
 */
export const goodsDetail = param =>
  api.get("/api/my/shoppingMall/goodsDetail", param);

/** 兑换商品（实体商品还有下一步）（cy）
 * @param {Object} param
 * @param {number} param.id  商品id
 */
export const goodsExchange = param =>
  api.post("/api/my/shoppingMall/goodsExchange", param);

/** 兑换记录（cy）
 * @param {Object} param
 * @param {number} param.page
 * @param {number} param.per_page
 */
export const exchangeRecords = param =>
  api.get("/api/my/shoppingMall/exchangeRecords", param);

/** 实体商品兑换(cy)
 * @param {Object} param
 * @param {string} param.id 商品id
 * @param {number} param.is_offline 1:线下 0：邮寄
 * @param {string} param.campu_id 校区id is_offline = 1必传
 */
export const physicalGoodsExchange = param =>
  api.post("/api/my/shoppingMall/physicalGoodsExchange", param);

/** 获取收货地址(cy)  */
export const getAddress = param => api.get("/api/address/get", param);

/** 获取商品兑换说明  */
export const exchangeExplain = param => api.get('/api/my/shoppingMall/exchangeExplain', param)

// 物流信息查询
export const logisticsInfo = param => api.get('/api/my/shoppingMall/logisticsInfo', param)